<template>
  <div class="wrapper-yuanshijianli">
    <div>
      <div class="top">
        <img src="../imgs/NotUpload.png" alt="" />
        <p class="p1">未上传附件简历</p>
        <p class="p2">上传附件简历会更受附近招聘者关注～</p>
      </div>
      <div class="bottom">
        <!-- 上传附件简历 -->
        <UploadBox v-if="!fileResumeFlag" @success="getSeekerImproveInfo">
          <a-tooltip>
            <template #title>支持doc、docx、pdf格式，大小不超过20M。</template>
            <a-button class="resume-upload__btn">
              <span class="upFiles">上传附件</span>
              <template #icon>
                <svg-icon name="shangchuanfujian" width="14" height="14" />
              </template>
            </a-button>
          </a-tooltip>
        </UploadBox>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import UserService from '@/api/user';
// import { getHeaders } from '@/api/axios';
// import { useRouter } from 'vue-router';
// import { message } from 'ant-design-vue';
import UploadBox from '@/views/home/components/UploadBox.vue';
const fileResumeFlag = ref<boolean>(false);
const emit = defineEmits(['upload']);
// 获取基本信息
async function getSeekerImproveInfo() {
  try {
    const resp = await UserService.selectSeekerForHomePage<any>();
    if (resp.code != 200) return;
    fileResumeFlag.value = resp.data.fileResumeFlag;
    emit('upload');
  } catch (error) {
    console.log(error);
  }
}
getSeekerImproveInfo();
// onMounted(() => {
//   getSeekerImproveInfo();
// });
</script>
<style lang="less" scoped>
.wrapper-yuanshijianli {
  text-align: center;
  padding-top: 100px;
  .top {
    .p1 {
      height: 14px;
      font-size: 14px;
      font-family:
        PingFangSC-Regular,
        PingFang SC;
      font-weight: 400;
      color: #333333;
      line-height: 14px;
      margin-top: 30px;
    }
    .p2 {
      height: 12px;
      font-size: 12px;
      font-family:
        PingFangSC-Regular,
        PingFang SC;
      font-weight: 400;
      color: #999999;
      line-height: 12px;
      margin-top: 15px;
    }
  }
  .resume-upload__btn {
    width: 220px;
    border: 1px solid #1890ff;
    color: #1890ff;
    margin-top: 16px;
    img {
      margin-right: 8px;
    }
  }
  .uploadResume {
    position: absolute;
    right: 20px;
    bottom: 30px;
  }
}
</style>
